﻿#ifndef USERDETAILTOEDITDLG_H
#define USERDETAILTOEDITDLG_H

#include <QWidget>
#include <QJsonObject>
#include <QBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QRadioButton>
#include <QButtonGroup>
#include <QFormLayout>
#include "eventfilterobject.h"
#include "SHttpClient.h"
#include "SApp.h"
#include <QMessageBox>
#include <QKeyEvent>




class UserDetail_toEditUserDlg : public QWidget
{
	Q_OBJECT
private:
	QJsonObject m_user;
	QJsonObject m_Newuser;

	QPushButton* m_closeBtn{};

	QLineEdit* m_user_id_edit{};
	QLineEdit* m_username_edit{};
	QButtonGroup* m_group_gender{};							//性别组
	QRadioButton* m_gender_boy{};							//男
	QRadioButton* m_gender_secret{};						//保密
	QRadioButton* m_gender_gril{};							//女 
	QLineEdit* m_mobile_edit{};
	QLineEdit* m_email_edit{};
	QLineEdit* m_password_edit{};
	QPushButton* m_ok_btn{};
	QPushButton* m_cancel_btn{};


signals:
	void userDataChanged(const QJsonObject& object);
	void windowclose();
public:
	UserDetail_toEditUserDlg(QWidget* parent = nullptr);
	~UserDetail_toEditUserDlg();

	void init();

	void setUserData(const QJsonObject& object);
	void updateUi();

	//获取修改后的数据：
	void GetEditData();

	void connectinit();

public:
	void on_OKBtnslot();

public:
	void keyPressEvent(QKeyEvent* ev)override;

};

#endif // !USERDETAILTOEDITDLG_H
